// package cn.ayanami.blog.admin.security;

// import org.springframework.context.annotation.Bean;
// import org.springframework.context.annotation.Configuration;
// import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
// import org.springframework.security.config.web.server.ServerHttpSecurity;
// import org.springframework.security.core.userdetails.MapReactiveUserDetailsService;
// import org.springframework.security.core.userdetails.User;
// import org.springframework.security.core.userdetails.UserDetails;
// import org.springframework.security.web.server.SecurityWebFilterChain;
// import static org.springframework.security.config.Customizer.withDefaults;

// @Configuration
// @EnableWebFluxSecurity
// public class WebfluxSecurityConfig {
//     @Bean
//     public MapReactiveUserDetailsService userDetailsService() {
//         UserDetails user = User.withUsername("admin")
//                 .password("123456")
//                 .roles("ADMIN")
//                 .build();
//         return new MapReactiveUserDetailsService(user);
//     }
    
// 	@Bean
// 	public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
// 		http
// 			.authorizeExchange(exchanges -> exchanges
// 				.pathMatchers("/admin/**").hasRole("ADMIN")
// 			    .anyExchange().permitAll()
// 			)
// 			.httpBasic(withDefaults())
// 			.formLogin(withDefaults());
// 		return http.build();
// 	}
// }
